#ifndef __GFX_FUNCTIONS
#define __GFX_FUNCTIONS

using namespace std;

SDL_Surface* imgLoad(SDL_Surface*& surf, string img);
SDL_Surface* imgLoadAlpha(SDL_Surface*& surf, string img);
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* dest, SDL_Rect* clip=NULL);
double pointDistance(SDL_Rect a, SDL_Rect b);
bool collideCircle(SDL_Rect a, SDL_Rect b);
bool collideRect(SDL_Rect a, SDL_Rect b);

class TextElement
{
    private:
        string str;
        string position;
        TTF_Font *font;
        SDL_Surface *message;
        SDL_Color color;
        int red, blue, green;
        int x, y;
        int size;

    public:
        TextElement();
        TextElement(string text, int coordX=0, int coordY=0, int r=255, int g=255, int b=255, int siz=12, string pos="center", string fontStr="freesansbold.ttf");
        ~TextElement();
        void draw(SDL_Surface*&); /* Draw self to screen */
};

#endif
